package cn.com.interstore.bg.fixture.org;

import org.nakedobjects.applib.fixtures.AbstractFixture;

import cn.com.interstore.bg.dom.org.ShippingMethod;

public class ShippingMethodFixture extends AbstractFixture {

	@Override
	public void install() {
		this.createShippingMethod("EMS", new Double(10));
		this.createShippingMethod("UPS", new Double(15));
		this.createShippingMethod("DHL", new Double(20));
		
	}

	private void createShippingMethod(final String name, Double chargeRate) {
		ShippingMethod sm = newTransientInstance(ShippingMethod.class);
		sm.setName(name);
		sm.setChargeRate(chargeRate);
		persist(sm);
	}
}
